package com.llstudio.jpa.converter;

import com.llstudio.jpa.entity.Gender;
import jakarta.persistence.AttributeConverter;

public class GenderConverter implements AttributeConverter<Gender, String> {
    @Override
    public String convertToDatabaseColumn(Gender gender) {
        return gender.getValue();
    }

    @Override
    public Gender convertToEntityAttribute(String value) {
        return Gender.of(value);
    }
}
